﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZyGame.Transport.Common
{
    public interface IChannel
    {
        bool IsConnected { get; }
        Task Connect();
        void AddOutput(IChannelHandler handler);
        void RemoveOutput(IChannelHandler handler);
        Task WriteAndFlush(object meesage);
        Task<T> WriteAndFlush<T>(object meesage);
        Task Close();
    }
}